package com.hellogood.work.evaluate.client;

import com.smartgwt.client.data.DSRequest;
import com.smartgwt.client.data.RestDataSource;
import com.smartgwt.client.widgets.grid.ListGrid;
import com.smartgwt.client.widgets.grid.ListGridField;
import com.smartgwt.client.widgets.tab.Tab;

public class TaskListTab extends Tab{
	private RestDataSource dataSource = null;
	private ListGrid listGrid = null;
	
	public TaskListTab(){
		initData();
		initView();
	}
	
	private void initData() {
		dataSource = new RestDataSource(){
			@Override
			protected Object transformRequest(DSRequest dsRequest) {
				int startRow = dsRequest.getStartRow();
				int endRow = dsRequest.getEndRow();
				String url = "";
				return super.transformRequest(dsRequest);
			}
		};
	}

	private void initView() {
		ListGridField idField = new ListGridField("id");
		ListGridField taskNoField = new ListGridField("taskNo");
		taskNoField.setHidden(true);
		ListGridField userField = new ListGridField("user","姓名");
		ListGridField customerField = new ListGridField("customer","客户");
		ListGridField startField = new ListGridField("start","开始时间");
		ListGridField endField = new ListGridField("end","完成时间");
		
		listGrid = new ListGrid();
		listGrid.setFields(idField,taskNoField,userField,customerField,startField,endField);
		setPane(listGrid);
		setTitle("任务列表");
	}
}
